<<<<<<< HEAD
import uuid

def generate_id():
    """Generate a unique 8-digit ID to identify the project"""
    return str(uuid.uuid4())[:8]

def create_Pokémon(Pokémon, name, Pokémon_type, level):
    """Add new Pokémon to the collection (maximum 4)"""
    if len(Pokémon) >= 4:
        print("Error❌: Maximum 4 Pokémon!")
        return Pokémon
    if not name or not Pokémon_type:
        print("Error❌: Name and type cannot be empty!") 
        return Pokémon
    if not isinstance(level, int) or level < 1:
        print("Error❌: The level must be a positive integer!")
        return Pokémon
    
    new_Pokémon = {
        "id": generate_id(),
        "name": name,
        "type": Pokémon_type,
        "level": level
        }
    Pokémon.append(new_Pokémon)
    print("Add new items sucessfully!")
    return Pokémon

if __name__ == "__main__":
    print("Testing create_Pokémon...")
    test_Pokémon = []
    test_Pokémon = create_Pokémon(test_Pokémon, "Warrior", "Fighter", 10)
    test_Pokémon = create_Pokémon(test_Pokémon, "Mage", "Wizard", 8)
    print(f"Total Pokémon: {len(test_Pokémon)}")
    print(test_Pokémon)
=======
def delete_item(items, item_id):
    """
    Delete item by ID
    
    Args:
        items (list): Current list of items
        item_id (str): ID of item to delete
        
    Returns:
        list: Updated list without deleted item
    """
    updated_items = [item for item in items if item["id"] != item_id]
    if len(updated_items) < len(items):
        deleted_item = next(item for item in items if item["id"] == item_id)
        print(f"✅ {deleted_item['name']} deleted successfully!")
        return updated_items
    else:
        print("❌ Item not found with that ID!")
        return items
    
def display_items(items):
    """Display all items in a user-friendly format"""
    print("\n=== MY GAME CHARACTERS ===")
    print(f"Items: {len(items)}/4\n")
    
    if not items:
        print("No items in your collection yet.")
        return
    
    for index, item in enumerate(items, 1):
        print(f"{index}. ID: {item['id']}")
        print(f"   Name: {item['name']}")
        print(f"   Type: {item['type']}")
        print(f"   Level: {item['level']}\n")
# Test
if __name__ == "__main__":
    print("Testing delete_item...")
    test_items = [
        {"id": "abc123", "name": "Warrior", "type": "Fighter", "level": 10},
        {"id": "def456", "name": "Mage", "type": "Wizard", "level": 8}
    ]

    display_items(test_items)
    test_items = delete_item(test_items, "abc123")
    display_items(test_items)
>>>>>>> Zyler-2025904133
